package com.shuyun.pipeline.valve;

import com.shuyun.pipeline.InstallCarPipeline;
import com.shuyun.pipeline.valve.impl.InstallEngineValve;
import com.shuyun.pipeline.valve.impl.InstallWindowsValve;
import com.shuyun.pipeline.valve.impl.QualityInspectionValve;
import com.shuyun.pipeline.valve.impl.SprayPaintValve;

/**
 * @description:
 * @author: shuai.chen@shuyun.com
 * @date: 2021/8/16 2:48 下午
 */
public class PipelineTest {
    public static void main(String[] args) {
        // 创建pipeline管道
        InstallCarPipeline installCarPipeline = new InstallCarPipeline();
        // 创建多个valve阀门
        InstallEngineValve installEngineValve = new InstallEngineValve();
        InstallWindowsValve installWindowsValve = new InstallWindowsValve();
        SprayPaintValve sprayPaintValve = new SprayPaintValve();
        QualityInspectionValve qualityInspectionValve = new QualityInspectionValve();
        // 阀门装入管道中
        installCarPipeline.addValve(installEngineValve);
        installCarPipeline.addValve(installWindowsValve);
        installCarPipeline.addValve(sprayPaintValve);
        installCarPipeline.setBasic(qualityInspectionValve);
        // 管道程序执行
        installCarPipeline.invoke(true);
    }
}
